package com.yuanqi.java.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.math.BigDecimal;

@Data
public class PurchaseOrderItemDTO {
    private Long id;
    
    @NotNull(message = "商品ID不能为空")
    @JSONField(name = "productId")
    private Long productId;
    
    // 展示用字段
    private String productName;
    private String productCode;
    
    @NotNull(message = "采购数量不能为空")
    @Positive(message = "采购数量必须大于0")
    @JSONField(name = "quantity")
    private Integer quantity;
    
    @NotNull(message = "采购单价不能为空")
    @Positive(message = "采购单价必须大于0")
    @JSONField(name = "price")
    private BigDecimal price;
    
    @JSONField(name = "remark")
    private String remark;
}
